#ifndef _ACCELEROMETRE_H_
#define _ACCELEROMETRE_H_

#include "CDatapoolServer.h"
#include <boost/thread/thread.hpp>
#include <boost/thread/xtime.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/circular_buffer.hpp>
#include <sys/time.h>
#include <unistd.h>
#include <sched.h>

class Accelerometre
{
	protected:

		int m_GpioXFd;
		int m_GpioYFd;

		bool m_shallStop;

		int ReadX();
		int ReadY();

		boost::thread * m_ProductionThread;

		boost::circular_buffer<int> * m_XAccumulator;
		boost::circular_buffer<int> * m_YAccumulator;

	public:

		int cd_AccelerationXID;
		int cd_AccelerationYID;

		Accelerometre();
		~Accelerometre();

		void ProductionThread();

		void Run();
		void Stop();
};

#endif
